﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace TB_WS.Class
{
    public class Gods_WhiteList
    {
        public static DataSet get_Gods_WhiteList(string Seller_Nick)
        {
            string sql = @"select * from Gods_WhiteList where Seller_id=(select id from Seller_Info where Seller_Nick='" + Seller_Nick + "')";
            return Unit.db_Conn.select(sql);
        }
        public static int insert_Gods_WhiteList(string Gods_ID,int Seller_ID)
        {
            string sql = @"insert into Gods_WhiteList values('" + Gods_ID + "'," + Seller_ID + ")";
            return Unit.db_Conn.Nonquery(sql);
        }

        public static int get_Gods_Count(string Gods_ID)
        {
            string sql = "select count(*) from Gods_WhiteList where Gods_id='" + Gods_ID + "'";
            return Convert.ToInt32(Unit.db_Conn.scalar(sql));
        }

        public static int delete_Gods_ID(string Gods_ID,int Seller_ID)
        {
            string sql = "delete from Gods_WhiteList where Gods_ID='" + Gods_ID + "' and Seller_ID="+Seller_ID;
            return Unit.db_Conn.Nonquery(sql);
        }
    }
}
